
<template >
<div>
  <div style="float:left;margin-top: 10px"><van-button round type="default" @click="ret()">返回</van-button></div>
  <div>
  <van-search
      v-model="value"
      show-action
      shape="round"
      label="商品"
      placeholder="请输入搜索关键词"
      @search="onSearch"

  >
    <template #action>
      <div ><van-button round type="primary"  @click="seac(value)">搜索</van-button></div>
    </template>
  </van-search>
  </div>
</div>
</template>

<script>
import { ref } from 'vue';
import { Toast } from 'vant';
export default {
  setup() {
    const value = ref('');
    const onSearch = (val) => Toast(val);
    return {
      value,
      onSearch,
    };
  },
  methods:{
    seac(name){
            this.$router.push({name:'shoptype',query:{value:name}})
          },
    ret(){
      this.$router.push("/mall")
    }

  }
}
</script>

<style scoped>

</style>